home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 44
/
Amiga Format CD44 (1999-08-26)(Future Publishing)(GB)(Track 1 of 3)[!][issue 1999-10].iso
/
-in_the_mag-
/
basics
/
prime_tests
/
primes_ace.b
next >
Wrap
Text File
|
1999-07-24
|
468b
|
23 lines
' This program finds the prime-numbers from 2 to 3000.
' It has been adapted for ACE BASIC's dislike of GOTO
' out of a FOR loop. Blitz may need something similar
DEFINT a-z
SCREEN 2,640,200,1,2
PRINT "prime numbers from 2 to 3000:"
BeginTime! = TIMER
FOR a = 2 TO 3000
FOR b = 3 TO a-1
IF a MOD b = 0 THEN b=9999
NEXT b
IF b<=9999 THEN REM PRINT a
NotPrim:
NEXT a
PRINT "time needed:"+STR$(TIMER-BeginTime!)+" s."
WHILE INKEY$ = "" : WEND